<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/6/13
 * Time: 11:18
 */


include_once ('conn.php');

$id = $_GET['id'];


$sql = "select * from `department` where `id` = '$id'";

$pd = mysqli_query($conn,$sql);


if(!$pd){
    die("失败了");
}

$arr = mysqli_fetch_assoc($pd);

?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form action="update_to.php" enctype="multipart/form-data" method="post">
    <table border="1" width="300">
        <tr><th>部门ID</th><td><?php echo $id?></td></tr>
        <tr><th>部门名称</th><td><input type="text" name="name" value="<?php echo $arr['name']?>"></td></tr>
        <tr><th>部门简介</th><td><input type="text" name="description" value="<?php echo $arr['description']?>"></td></tr>
        <input type="text" name="id" value="<?php echo $id?>" hidden>
        <tr align="center"><td colspan="2"><input type="submit" value="提交"></td></tr>
    </table>
</form>

</body>
</html>









